<%@ Page Language="C#" EnableViewState="false" ValidateRequest="false" AutoEventWireup="true" 
	MasterPageFile="~/App_ThemeMasters/NoStyle/OneColumnLayout.Master" Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" EnableEventValidation="false" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>
<%@ Register Assembly="ScsAspNet" Namespace="Articles.Gui.AspNet" TagPrefix="art" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardHeaderPageContent.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->
<script runat="server">
	public bool PreloadFreeTextBox = false;
    public string TitleFormat = "$glgo.title$ - $bArt.keyword$";
</script>
<asp:Content ID="c1" ContentPlaceHolderID="mainContent" runat="server">
    <div class="verticalbg blogSideSet">
	    <swf:BizProc ID="bArt" runat="server" FactoryName="genericArticles">
		    <State entireTree="true" EditModeSessionKey="BlogGlobalEdit"  />
		    <ParentBizProc id="loginBP"  />
	    </swf:BizProc>
	    <swf:BizProc ID="bcArt" runat="server" FactoryName="genericArticles">
	    <State imageRes="Thumbnail" includeAssociations="Reader Comments" listDetailLevel="fullDetails" EditModeSessionKey="GlobalEdit" orderBy="(CASE WHEN [publishDate] IS NULL THEN nc.dateCreated ELSE [publishDate] END)" sortDir="DESC"  />
		    <ParentBizProc id="bArt" fieldName="id" dataId="pid" />
	    </swf:BizProc>
	    <swf:BizProc ID="blogToc" runat="server" FactoryName="genericArticles">
	    <State imageRes="Thumbnail" listDetailLevel="fullDetails" EditModeSessionKey="GlobalEdit" orderBy="(CASE WHEN [publishDate] IS NULL THEN nc.dateCreated ELSE [publishDate] END)" sortDir="DESC"  />
		    <ParentBizProc id="bArt" fieldName="id" dataId="pid" />
	    </swf:BizProc>
	    <swf:BizProc ID="blogIndex" runat="server" FactoryName="filterKeywords">
			<State EditModeSessionKey="BlogGlobalEdit" />
			<ParentBizProc id="bArt" fieldName="id" dataId="pid" />
			<ParentBizProc id="bcArt" dataId="pushCriteria" />
	    </swf:BizProc>
	    <swf:BizProc ID="blogSearch" runat="server" FactoryName="basicSearch">
			<ParentBizProc id="bcArt" dataId="pushCriteria" />
	    </swf:BizProc>
	<div class="contentwrap">
        <div class="clearer"></div>
			<span class="button4"><saj:ActionButton runat="server" ID="ActionButton1" Actions="bcArt.SwitchEdit" Text="Edit" SessionBoolSwitch="GlobalEdit"  /></span>
			<span class="button1"><saj:ActionButton runat="server" ID="ActionButton2" Actions="bcArt.SwitchTranslation" Text="Translate" SessionBoolSwitch="TranslationMode" /></span>
			<span class="button1"><saj:ActionButton runat="server" ID="ActionButton12" Actions="bcArt.TranslateArticle" Text="Auto Translate" /></span>
			<span class="button1"><saj:ActionButton runat="server" ID="ActionButton3" Actions="bcArt.AddBizObj" Text="Add" /></span>
			<span class="button6"><saj:ActionButton runat="server" ID="ActionButton4" Actions="bcArt.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><saj:ActionButton runat="server" ID="ActionButton5" Actions="bcArt.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><saj:ActionButton runat="server" ID="ActionButton6" Actions="bcArt.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
			<span class="button1"><saj:ActionButton runat="server" ID="ActionButton7" Actions="bcArt.SetArticlePicture" Text="Set Image" ToolTip="Set primary media for this article" 
				PopupPage="../popups/SetArticleImagePopup.aspx" PopupHeight="535px" PopupWidth="800px" PopupTitle="Select a primary image for this article." /></span>
			<span class="button6"><saj:ActionButton runat="server" ID="ActionButton13" Actions="bcArt.ClearFilterSort,blogSearch.CancelEdits" Text="Show All" /></span>
			
        <div class="clearer"></div>

		<saj:NitobiBizObjDisplay ID="bcd2" runat="server"
			ParentBizProcIds="bcArt"
			ReadOnlyTemplate=""
			EditableTemplate="Articles.Gui.AspNet.ArticleRWDisplay-SimpleEditor-NoReparent" />
			
        <saj:NitobiPaginationDisplay ID="pager2" runat="server" ParentBizProcIds="bcArt" 
			PagesClass="PagerPages" CurrentPageClass="PagerCurrentPage" CssClass="Pager" />	
		<div class="blogRoll">
			<saj:ComplexBizObjListDisplay ID="ComplexBizObjListDisplay1" MaxElements="20" runat="server" 
				ParentBizProcIds="bcArt"
				ReadOnlyTemplate="Blog.Gui.AspNet.BlogList-TitlePubDateBodyWComments" EditableTemplate="Blog.Gui.AspNet.BlogList-TitlePublinkDateBody" >
				<macros includeAssociations="Reader Comments"
				navLink="javascript:if(document.getElementById('ctl00_mainContent_bcd2_baseTitle') == null)window.location.href='$CmpSetting(sitePath)$/articles/$CalcArticleIds($pid$,$uniqueId$)$.aspx';else $_bizProcId$BizProc.triggerEvent('$_controlId$','bizObjSelected','$id$');"
				userCommentNavLink="$CmpSetting(sitePath)$/articles/$CalcArticleIds($pid$,$uniqueId$)$.aspx#UserComments" />
			</saj:ComplexBizObjListDisplay>
	    </div>
	    
        <saj:NitobiPaginationDisplay ID="pager1" runat="server" ParentBizProcIds="bcArt" 
			PagesClass="PagerPages" CurrentPageClass="PagerCurrentPage" CssClass="Pager" />	
	</div>	

</asp:Content>
<asp:Content id="c2" ContentPlaceHolderID="AboveMain" runat="server">
	<script type="text/javascript">
	    function toggleTabs(cId, c1, dId) {
	        for (i = 1; ; i++) {
	            var a = document.getElementById(cId + i);
	            var b = document.getElementById(dId + i);
	            if (a == null || a == '')
	                break;

	            if (i == c1) {
	                a.className = 'currenttab';
	                b.style.display = 'block';
	            }
	            else {
	                a.className = '';
	                b.style.display = 'none';
	            }
	        }
	    }
</script>
        
	<div class="clearer"></div>
	<div class="tabs" style="padding-left:0px; padding-right:10px;">
			<ul>
				<li id="t1" class="currenttab"><div class="firstTab"><swf:DivLayers runat="server" ID="tl1" SkinID="Tab"><asp:HyperLink onclick="toggleTabs('t','1','xfd');" runat="server" ID="_cmpMngrTab1" Text="Bio" NavigateUrl="javascript:;" /></swf:DivLayers></div></li>
				<li id="t2"><swf:DivLayers runat="server" ID="tl2" SkinID="Tab"><asp:HyperLink runat="server" onclick="toggleTabs('t','2','xfd');" ID="_blogTOCLbl" Text="TOC" NavigateUrl="javascript:;" /></swf:DivLayers></li>
				<li id="t3"><div class="lastTab"><swf:DivLayers runat="server" ID="tl3" SkinID="Tab"><asp:HyperLink runat="server" onclick="toggleTabs('t','3','xfd');" ID="_blogSrLbl" Text="Search" NavigateUrl="javascript:;" /></swf:DivLayers></div></li>
			</ul>
		</div>
	<div class="clearer"></div>
		
	<swf:DivLayers ID="mdl1" runat="server" SkinID="MainTabArea">
			<div id="xfd1">
				<div class="bloggerBioArea">
				<saj:NitobiBizObjDisplay ID="articleDetail1Display" runat="server"
					ParentBizProcIds="bArt"
					ReadOnlyTemplate="Articles.Gui.AspNet.ArticleDisplay-ROBlogBio" 
					EditableTemplate="Articles.Gui.AspNet.ArticleDisplay-BlogBio" />
				</div>
				<div class="clearer"></div>
	            <span class="button4"><saj:ActionButton runat="server" ID="editMode" Actions="bArt.SwitchEdit" Text="Edit" SessionBoolSwitch="BlogGlobalEdit"  /></span>
	            <span class="button1"><saj:ActionButton runat="server" ID="translationBtn" Actions="bArt.SwitchTranslation" Text="Translate" SessionBoolSwitch="TranslationMode" /></span>
	            <span class="button6"><saj:ActionButton runat="server" ID="updateBtn" Actions="bArt.UpdateBizObj" Text="Update" /></span>
	            <span class="button1"><saj:ActionButton runat="server" ID="setPicBtn" Actions="bArt.SetArticlePicture" Text="Set Image" ToolTip="Set primary media for this article" 
		            PopupPage="../popups/SetArticleImagePopup.aspx" PopupHeight="535px"  PopupWidth="820px" PopupTitle="Select a primary image for this article." /></span>
                <div class="clearer"></div>
			</div>
			<div id="xfd2" style="display:none;">
				<div class="BlogIndex SummaryArticle"><div class="SmallerArticleList">
					<h3><asp:Label runat="server" ID="_tocLbl">Blog Entries</asp:Label></h3>
					<saj:ComplexBizObjListDisplay ID="bil" runat="server" 
						ParentBizProcIds="blogToc"
						ReadOnlyTemplate="Articles.Gui.AspNet.ArticleListDisplay-TitleUDate" >
						<macros 
						navLink="javascript:if(document.getElementById('ctl00_mainContent_bcd2_baseTitle') == null)window.location.href='$CmpSetting(sitePath)$/articles/$CalcArticleIds($pid$,$uniqueId$)$.aspx';else $_bizProcId$BizProc.triggerEvent('$_controlId$','bizObjSelected','$id$');" />
					</saj:ComplexBizObjListDisplay>
				</div></div>
			</div>
			<div id="xfd3" style="display:none;">
				<h3><asp:Label runat="server" ID="_searchLbl">Search Blog:</asp:Label></h3>
				<saj:NitobiBizObjDisplay ID="NitobiBizObjDisplay1" runat="server"
					ParentBizProcIds="blogSearch"
					EditableTemplate="FilterSort.Gui.AspNet.SimpleSearchFilterSortDisplay" />
				<span class="button6"><saj:ActionButton runat="server" ID="ActionButton14" Actions="blogSearch.UpdateBizObj" Text="Search Blog" /></span>
				
				<h3 class="H3SectionPacer"><asp:Label runat="server" ID="_indexLbl">Blog Index:</asp:Label></h3>
				<span class="button1"><saj:ActionButton runat="server" ID="ActionButton8" Actions="blogIndex.AddBizObj" Text="Add" /></span>
				<span class="button6"><saj:ActionButton runat="server" ID="ActionButton9" Actions="blogIndex.UpdateBizObj" Text="Update" /></span>
				<span class="button1"><saj:ActionButton runat="server" ID="ActionButton10" Actions="blogIndex.CancelEdits" Text="Cancel" /></span>
				<span class="button5"><saj:ActionButton runat="server" ID="ActionButton11" Actions="blogIndex.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
				
				<div class="BlogSearchKeywords">
						<saj:ComplexBizObjListDisplay ID="inl" runat="server" 
							ParentBizProcIds="blogIndex"
							ReadOnlyTemplate="FilterSort.Gui.AspNet.ArticleKeywordListDisplay"
							EditableTemplate="FilterSort.Gui.AspNet.ArticleKeywordListRWDisplay" >
							<macros 
							navLink="javascript:$_bizProcId$BizProc.triggerEvent('$_controlId$','bizObjSelected','$id$');" />
						</saj:ComplexBizObjListDisplay>
				</div>
			</div>
		</swf:DivLayers>
	
	
	 
</asp:Content>